package com.stylefeng.guns.rest.modular.version.service;

import com.baomidou.mybatisplus.mapper.Condition;
import com.stylefeng.guns.rest.common.persistence.dao.VersionIosMapper;
import com.stylefeng.guns.rest.common.persistence.dao.VersionMapper;
import com.stylefeng.guns.rest.common.persistence.dao.ViewRecordMapper;
import com.stylefeng.guns.rest.common.persistence.model.Version;
import com.stylefeng.guns.rest.common.persistence.model.VersionIos;
import com.stylefeng.guns.rest.common.persistence.model.ViewRecord;
import com.stylefeng.guns.rest.modular.artitle.controller.dto.ArticleDetailResponse;
import com.stylefeng.guns.rest.modular.catalogy.controller.dto.ArticleRequest;
import com.stylefeng.guns.rest.modular.viewrecord.controller.dto.RecordListRequest;
import com.stylefeng.guns.rest.modular.viewrecord.controller.dto.ViewRecordResponse;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * Created by ASUS-PC on 2018/6/28.
 */
@Service
public class VersionService {
    @Autowired
    VersionMapper versionMapper;
    @Autowired
    VersionIosMapper versionIosMapper;

    //查询当前最新版本
    public Version getVersion(){
        return versionMapper.selectVersion();
    }
    //返回ios目前版本
    public List<VersionIos> getVersionIos(){
        List<VersionIos> list = versionIosMapper.selectList(Condition.create().orderBy("id",false));
        return list;
    }

}
